package homework0307;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class WriteStringDemo1 {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos=new FileOutputStream("fos.txt");
        String line="星星电灯，照亮我的家门";
        byte[] date=line.getBytes(StandardCharsets.UTF_8);
        fos.write(date);

        fos.write("让孤独的孩子，找到回家的路".getBytes(StandardCharsets.UTF_8));
        System.out.println("写出完成");
        fos.close();

    }
}
